package com.hyh.shiyanshiguanli.mapper;

import com.github.pagehelper.Page;
import com.hyh.shiyanshiguanli.domain.dto.PageDTO;
import com.hyh.shiyanshiguanli.domain.entity.Instrument;
import com.hyh.shiyanshiguanli.domain.entity.LabLesson;
import com.hyh.shiyanshiguanli.domain.entity.LibInformation;
import com.hyh.shiyanshiguanli.domain.entity.Reagent;
import com.hyh.shiyanshiguanli.domain.vo.LabLessonPageVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @author hyh
 * @version 1.0
 */
@Mapper
public interface LabLessonMapper {




    @Select("select * from lib where status = 0")
    List<LibInformation> selectLab();

    @Select("select * from instrument where num >= 0")
    List<Instrument> selectInstrument();

    @Select("select * from reagent where num >= 0")
    List<Reagent> selectReagent();

    @Select("select num from instrument where id = #{id}")
    Integer selectNumById(@Param("id") Integer id);

    @Select("select num from reagent where id = #{id}")
    Integer selectNumByIdReagent(Integer id);

    void add(LabLesson labLesson);

    Page<LabLessonPageVO> page();
    @Select("select * from lab_lesson where id = #{id}")
    LabLesson selectById(@Param("id") Integer id);
    @Update("update lab_lesson set stop_status = #{start} where id = #{id}")
    void updateStatus(@Param("start") Integer start,@Param("id") Integer id);
}
